<template>
    <div class="app-container">
        <el-card class="operate-container" shadow="never">
            <i class="el-icon-tickets"></i>
            <span>美团套餐</span>
        </el-card>
        <div class="table-container">
            <el-table
                    ref="deviceTable"
                    :data="list"
                    style="width: 100%;"
                    @selection-change="handleSelectionChange"
                    v-loading="listLoading"
                    border
            >
                <el-table-column type="selection" width="60" align="center"></el-table-column>
                <el-table-column label="标题" width="150" align="center">
                    <template slot-scope="scope">{{scope.row.title | typeFilter}}</template>
                </el-table-column>
                <el-table-column label="价格" width="250" align="center">
                    <template slot-scope="scope">{{scope.row.price}}</template>
                </el-table-column>
                <el-table-column label="美团套餐id" width="200" align="center">
                    <template slot-scope="scope">{{scope.row.dealId}}</template>
                </el-table-column>
                <el-table-column label="美团团购id" width="250" align="center">
                    <template slot-scope="scope">{{scope.row.dealgroupId}}</template>
                </el-table-column>
            </el-table>
        </div>
        <div class="pagination-container">
            <el-pagination
                    background
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    layout="total, sizes,prev, pager, next,jumper"
                    :page-size="listQuery.pageSize"
                    :page-sizes="[5,10,15]"
                    :current-page.sync="listQuery.pageNum"
                    :total="total"
            ></el-pagination>
        </div>
    </div>
</template>
<script>
    import { getmeituandeal } from "@/api/qsg/devicemeal";

    const defaultListQuery = {
        pageNum: 1,
        pageSize: 100
    };
    export default {
        name: "deviceList",
        data() {
            return {
                listQuery: Object.assign({}, defaultListQuery),
                list: null,
                total: null,
                listLoading: false,
                multipleSelection: []
            };
        },
        created() {
            this.getList();
        },
        methods: {
            getList() {
                this.listLoading = true;
                getmeituandeal(this.listQuery).then(response => {
                    this.listLoading = false;
                    this.list = response.data;
                });
            }
        }
    };
</script>
<style scoped>
    .input-width {
        width: 203px;
    }
</style>


